home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / librw / RWTValMultiSetIterator.z / RWTValMultiSetIterator
Encoding:
Text File  |  2002-10-03  |  7.3 KB  |  199 lines

  1.  
  2.  
  3.  
  4. RRRRWWWWTTTTVVVVaaaallllMMMMuuuullllttttiiiiSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr((((3333CCCC++++++++))))                      RRRRWWWWTTTTVVVVaaaallllMMMMuuuullllttttiiiiSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr((((3333CCCC++++++++))))
  5.  
  6.  
  7.  
  8. NNNNaaaammmmeeee
  9.      RWTValMultiSetIterator<T,C> - Rogue Wave library class
  10.  
  11. SSSSyyyynnnnooooppppssssiiiissss
  12.               #include<rw/tvmset.h>
  13.  
  14.  
  15.  
  16.               RWTValMultiSet< T,C> vs;
  17.           RWTValMultiSetIterator< T,C> itr(vs);
  18.  
  19. SSSSttttaaaannnnddddaaaarrrrdddd CCCC++++++++ LLLLiiiibbbbrrrraaaarrrryyyy DDDDeeeeppppeeeennnnddddeeeennnntttt!!!!
  20.      RRRRWWWWTTTTVVVVaaaallllMMMMuuuullllttttiiiiSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr requires the Standard C++ Library.
  21.  
  22.  
  23. DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn
  24.      RRRRWWWWTTTTVVVVaaaallllMMMMuuuullllttttiiiiSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr is supplied with TTTToooooooollllssss....hhhh++++++++ 7 to provide an
  25.      iterator interface for class RRRRWWWWTTTTVVVVaaaallllMMMMuuuullllttttiiiiSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr that has backward
  26.      compatibility with the container iterators provided in TTTToooooooollllssss....hhhh++++++++ 6.x. The
  27.      order of iteration over an RRRRWWWWTTTTVVVVaaaallllMMMMuuuullllttttiiiiSSSSeeeetttt is dependent on the supplied
  28.      comparator object parameter C as applied to the values stored in the
  29.      container.  The current item referenced by this iterator is undefined
  30.      after construction or after a call to rrrreeeesssseeeetttt(((()))).  The iterator becomes
  31.      valid after being advanced with either a preincrement or ooooppppeeeerrrraaaattttoooorrrr(((()))).  For
  32.      both ooooppppeeeerrrraaaattttoooorrrr++++++++ and ooooppppeeeerrrraaaattttoooorrrr(((()))), iterating past the last element will
  33.      return a value equivalent to boolean ffffaaaallllsssseeee.  Continued increments will
  34.      return a value equivalent to ffffaaaallllsssseeee until rrrreeeesssseeeetttt(((()))) is called.
  35.  
  36. PPPPeeeerrrrssssiiiisssstttteeeennnncccceeee
  37.      None
  38.  
  39. EEEExxxxaaaammmmpppplllleeeessss
  40.               #include<rw/tvmset.h>
  41.  
  42.  
  43.  
  44.               #include<iostream.h>
  45.           #include<rw/cstring.h>
  46.           int main(){
  47.              RWTValMultiSet<RWCString,greater<RWCString> > a;
  48.              RWTValMultiSetIterator<RWCString,greater<RWCString> > itr(a);
  49.              a.insert("John");
  50.              a.insert("Steve");
  51.              a.insert("Mark");
  52.              a.insert("Steve");
  53.              for(;itr();)
  54.                cout << itr.key() << endl;
  55.              return 0;
  56.           }
  57.           Program Output
  58.           Steve
  59.           Steve
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. RRRRWWWWTTTTVVVVaaaallllMMMMuuuullllttttiiiiSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr((((3333CCCC++++++++))))                      RRRRWWWWTTTTVVVVaaaallllMMMMuuuullllttttiiiiSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr((((3333CCCC++++++++))))
  71.  
  72.  
  73.  
  74.           Mark
  75.  
  76. PPPPuuuubbbblllliiiicccc CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrrssss
  77.      John
  78.  
  79.  
  80.  
  81.               RRRRWWWWTTTTVVVVaaaallllMMMMuuuullllttttiiiiSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr<<<<TTTT,,,,CCCC>>>>(RWTValMultiSet< T,C> &h);
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.      Creates an iterator for the multi-set hhhh.  The iterator begins in an
  89.      undefined state and must be advanced before the first element will be
  90.      accessible
  91.  
  92. PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr OOOOppppeeeerrrraaaattttoooorrrrssss
  93.               RWBoolean
  94.           ooooppppeeeerrrraaaattttoooorrrr(((())))();
  95.  
  96.  
  97.      Advances sssseeeellllffff to the next element.  If the iterator has advanced past the
  98.      last element in the collection, ffffaaaallllsssseeee will be returned.  Otherwise, ttttrrrruuuueeee
  99.      will be returned.
  100.  
  101.               RWBoolean
  102.           ooooppppeeeerrrraaaattttoooorrrr++++++++();
  103.  
  104.  
  105.      Advances sssseeeellllffff to the next element.  If the iterator has been reset or
  106.      just created sssseeeellllffff will now reference the first element.  If, before
  107.      iteration, sssseeeellllffff referenced the last association in the multi-set, sssseeeellllffff
  108.      will now reference an undefined value and ffffaaaallllsssseeee will be returned.
  109.      Otherwise, ttttrrrruuuueeee is returned. Note: no postincrement operator is provided.
  110.  
  111. PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr FFFFuuuunnnnccccttttiiiioooonnnnssss
  112.               RWTValMultiSet<T,C>*
  113.           ccccoooonnnnttttaaaaiiiinnnneeeerrrr(((()))) const;
  114.  
  115.  
  116.      Returns a pointer to the collection being iterated over.
  117.  
  118.               T
  119.           kkkkeeeeyyyy();
  120.  
  121.  
  122.      Returns the value pointed to by sssseeeellllffff.
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. RRRRWWWWTTTTVVVVaaaallllMMMMuuuullllttttiiiiSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr((((3333CCCC++++++++))))                      RRRRWWWWTTTTVVVVaaaallllMMMMuuuullllttttiiiiSSSSeeeettttIIIItttteeeerrrraaaattttoooorrrr((((3333CCCC++++++++))))
  137.  
  138.  
  139.  
  140.               void
  141.           rrrreeeesssseeeetttt();
  142.           void
  143.           rrrreeeesssseeeetttt(RWTValMultiSet<T,C>& h);
  144.  
  145.  
  146.      Resets the iterator so that after being advanced it will point to the
  147.      first element of the collection.  Using rrrreeeesssseeeetttt(((()))) with no argument will
  148.      reset the iterator on the current container.  Supplying a RRRRWWWWTTTTVVVVaaaallllMMMMuuuullllttttiiiiSSSSeeeetttt
  149.      to rrrreeeesssseeeetttt(((()))) will reset the iterator on that container.
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.